package control;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConexionDB {
     static final String USER = "root";
     static final String PASSWORD = "12345";
     static final String CONTROLADOR = "com.mysql.jdbc.Driver";
     static final String URL_BASEDATOS = "jdbc:mysql://localhost/mydb";

    public Connection establecerConexion(){
        Connection conexion = null;
        try {
            Class.forName(CONTROLADOR);
            conexion = DriverManager.getConnection(URL_BASEDATOS, USER, PASSWORD);
        } catch( ClassNotFoundException | SQLException  ignore){}
        return conexion;
    }
}
